<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/7/23 0023
  Time: 下午 2:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html><head><link rel="stylesheet" href="${pageContext.request.contextPath}/static/easyui/bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/css/common/box.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/css/common/checkbox.css">
    <style type="text/css">
        <%--住址--%>
        a:hover {
            text-decoration: none;
        }

        .bgc-w {
            background-color: #fff;
        }
        .red{
            color:#d9534f;
            font-weight:100;
            font-size:1px;
        }
    </style>
</head><body><div class="row" style="padding-top: 10px;">
    <div class="col-md-2">
        <h1 style="font-size: 24px; margin: 0;" class="">通知管理</h1>
    </div>
    <div class="col-md-10 text-right">
        <a href="##"><span class="glyphicon glyphicon-home"></span> 首页</a> &gt; <a disabled="disabled">通知管理</a>
    </div>
</div>
<div class="row" style="padding-top: 15px;">
    <div class="col-md-12">
        <!--id="container"-->


        <div class="bgc-w box">
            <!--盒子头-->
            <div class="box-header">
                <h3 class="box-title">
                    <a href="javascript:history.back();" class="label label-default" style="padding: 5px;"> <i class="glyphicon glyphicon-chevron-left"></i> <span>返回</span>
                    </a>
                </h3>
            </div>
            <form action="" method="post" id="thisForm" onsubmit="return check();">
                <!--盒子身体-->
                <div class="box-body no-padding">
                    <div class="box-body">
                        <div class="alert alert-danger alert-dismissable" role="alert" style="display: none;">
                            错误信息:<button class="close" type="button">×</button>
                            <span class="error-mess"></span>
                        </div>
                        <div class="row">
                            <div class="col-md-6 form-group">
                                <label class="control-label"><span>类型</span></label>
                                <select class="form-control" id="typeid" name="typeId">
                                    <option value="10">公告</option>
                                    <option value="11">通知</option>
                                    <option value="12">投票</option>
                                </select>
                            </div>
                            <div class="col-md-6 form-group">
                                <label class="control-label"><span>状态</span></label>
                                <select class="form-control" id="statusid" name="statusId">
                                    <option value="14">一般</option>
                                    <option value="15">重要</option>
                                    <option value="16">紧急</option>
                                </select>
                            </div>
                            <div class="col-md-6 form-group">
                                <label class="control-label"><span>标题</span></label>
                                <input class="form-control" id="biaoti" value="猿来入此新版发布了" name="title">
                            </div>
                            <%--  <div class="col-md-6 form-group">
                                  <label class="control-label"><span>链接</span></label>
                                  <input class="form-control" value="https://www.yuanlrc.com/" name="url">
                              </div>--%>
                            <div class="col-md-6 form-group">
                                <label class="control-label"><span>描述</span></label>
                                <textarea class="form-control text" id="miaosu" rows="5" cols="20" name="content">https://www.yuanlrc.com/</textarea>
                            </div>
                            <%--<div class="col-md-6 form-group">
                                <label class="control-label"><span>置顶</span></label><br>
                                <span class="labels"><label><input name="top" type="checkbox" checked=""><i>✓</i></label></span>
                            </div>--%>


                        </div>
                    </div>
                </div>

                <!--盒子尾-->
                <div class="box-footer">
                    <input class="btn btn-primary" id="save" type="button"  value="更新">
                    <input class="btn btn-default" id="cancel" type="button" value="取消" onclick="window.history.back();">
                </div>
            </form>
        </div>

    </div>
</div>


<script>
    $(document).ready(function () {
        var json = ${requestScope.byid};
        console.log(json);
       /* alert(json.informEntities[0].typrName);*/
        console.log(json.id);
        console.log(json.peoPle);
        var miaosu =$("#miaosu").val(json.miaoSu);
        var miaosu =$("#biaoti").val(json.biaoTi);



        $("#save").click(function () {
            alert("确认修改");
            var listnum = $("#typeid").val();
            var  listnum2 =$("#statusid").val();
            var  biaoti= $("#biaoti").val();
            var  miaosu= $("#miaosu").val();
            var  js=json.id;

            $.ajax({
                async:true,
                type:"POST",
                url:"${pageContext.request.contextPath}/insert/update",
                data:{
                    id:js,
                    Typeid:listnum,
                    StatelId:listnum2,
                    BiaoTi:biaoti,
                    MiaoSu:miaosu
                },
                dataType:"json",
                success:function (rel) {
                    if (rel.stats){
                        alert(rel.msg);
                        /*跳转*/
                    window.location.href = '../../admin/notice/notice.jsp';
                       /*window.open('admin/index/notice/notice.jsp');*/
                    }else {
                        alert(rel.msg);
                    }
                },
                error:function (rel) {
                    alert("失败");
                }

            })


        })


    })

</script>


<style type="text/css">
    #thismodal .modal-dialog {
        width: 500px;
        top:20%;
    }

    #thismodal .modal-body .icon {
        height: 80px;
        width: 80px;
        margin: 20px auto;
        border-radius: 50%;
        color: #aad6aa;
        border: 3px solid #d9ead9;
        text-align: center;
        font-size: 44px;
    }

    #thismodal .modal-body .icon .glyphicon {
        font-size: 46px;
        top: 14px;
    }

    #thismodal .modal-p {
        margin: 20px auto;
    }

    #thismodal .modal-body .modal-p h2 {
        text-align: center;
    }

    #thismodal .modal-body .modal-p p {
        text-align: center;
        color: #666;
        font-size: 16px;
        padding-top: 8px;
        font-weight: 300;
    }

    #thismodal .modal-p .btn {
        margin-left: 40%;
        width: 100px;
        height: 40px;
    }

    #thismodal .modal-error .icon {
        color: #f27474;
        border: 3px solid #f27474;
    }
</style>

<div class="modal fade in" id="thismodal" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body modal-success" style="display: none;">
                <div class="icon">
                    <span class="glyphicon glyphicon-ok"></span>
                </div>
                <div class="modal-p">
                    <h2>操作成功</h2>
                    <!--<p style="">已回复</p>-->
                    <div class="modal-p">
                        <button type="button" class="btn btn-primary successToUrl" data-dismiss="modal">确定</button>
                    </div>
                </div>
            </div>
            <div class="modal-body modal-error" style="display: none;">
                <div class="icon">
                    <span class="glyphicon glyphicon-remove"></span>
                </div>
                <div class="modal-p">
                    <h2 style="text-align: center;">错误信息</h2>
                    <p class="modal-error-mess">此处将显示弹出框的错误提示信息</p>
                    <div class="modal-p">
                        <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
                    </div>
                </div>
            </div>

        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>

<!-- /.modal -->
<script type="text/javascript" src="js/modalTip.js"></script>





</body></html>
